package br.com.comdoc.ajustes;

//@author Jorge

import br.com.comdoc.telas.Abrir;
import br.com.comdoc.telas.CadastroEmpresas;
import br.com.comdoc.telas.Novo;
import br.com.comdoc.telas.Principal;
import java.awt.Color;
import java.awt.GraphicsConfiguration;
import java.awt.Rectangle;
import sun.java2d.SunGraphicsEnvironment;


public class Inicializacao {
    
    public static void startMainScreen(){        
        Principal pr = new Principal();
        GraphicsConfiguration config = pr.getGraphicsConfiguration();
        Rectangle usableBounds = SunGraphicsEnvironment.getUsableBounds(config.getDevice());
        pr.setMaximizedBounds(new Rectangle(0, 0, usableBounds.width, usableBounds.height));
        pr.setExtendedState((pr.getExtendedState() & Principal.MAXIMIZED_BOTH) == 
                Principal.MAXIMIZED_BOTH ? Principal.NORMAL : Principal.MAXIMIZED_BOTH); 
        pr.getContentPane().setBackground(new Color(102, 102, 102)); 
        pr.pack();
        pr.show();
    }
    
    public static void startNovo(){
        Novo novo = new Novo(null, true);        
        novo.setVisible(true);
    }
    
    public static void startAbrir(){
        Abrir abrir = new Abrir(null, true);        
        abrir.setVisible(true);
    }
    
    public static void startCadastrarEmpresas(){
        CadastroEmpresas cadaEmpresa = new CadastroEmpresas(null, true);
        cadaEmpresa.setVisible(true);
    }    
}
